package com.central.scheduler.dao.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.central.common.model.SuperEntity;
import com.central.scheduler.common.enums.FailureStrategy;
import com.central.scheduler.common.enums.Priority;
import com.central.scheduler.common.enums.ReleaseState;
import com.central.scheduler.common.enums.WarningType;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * @author Tindy
 * @date 2021/11/5
 * @describe
 */
@Data
@TableName("sch_schedules")
public class Schedule extends SuperEntity {

    /**
     * process definition code
     */
    private long processDefinitionCode;

    /**
     * process definition name
     */
    @TableField(exist = false)
    private String processDefinitionName;


    /**
     * schedule description
     */
    @TableField(exist = false)
    private String definitionDescription;

    /**
     * schedule start time
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date startTime;

    /**
     * schedule end time
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date endTime;

    /**
     * timezoneId
     * <p>see {@link java.util.TimeZone#getTimeZone(String)}
     */
    private String timezoneId;

    /**
     * crontab expression
     */
    private String crontab;

    /**
     * failure strategy
     */
    private FailureStrategy failureStrategy;

    /**
     * warning type
     */
    private WarningType warningType;

    /**
     * created user id
     */
    private Long userId;

    /**
     * created user name
     */
    private String username;
    /**
     * project id
     */
    private Long proId;

    /**
     *project  name
     */
    private String proName;
    /**
     * release state
     */
    private ReleaseState releaseState;

    /**
     * warning group id
     */
    private Long warningGroupId;


    /**
     * process instance priority
     */
    private Priority processInstancePriority;

    /**
     * environment code
     */
    private Long environmentCode;


}
